/*
 *  CSMACAListener.h
 *  simulator
 *
 *  Created by  on 4/4/12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef WiFiMACSim_CSMACAListener_hpp
#define WiFiMACSim_CSMACAListener_hpp

#include "Node.hpp"
#include "Message.hpp"
#include "Medium.hpp"
#include "Message.hpp"

SimNamespaceBegin


class	CSMACAListener : public StateMachineNode<CSMACAListener>
{
public:
	
	enum {
		waitForData				=	0 ,
		sendACK					=	1 ,
		waitConfirmACK			=	2 ,
		waitCollision			=	3
	} ;
	
	ID			sender ;
	Message*	message ;
	UInteger	createSIFS;
	UInteger	createWaitCollision;

	
	CSMACAListener ( ID const & name ) ;

	void	update_waitForData	( UInteger currentTime , Medium::MsgSet const & currentReception ) ;
	void	update_sendACK	( UInteger currentTime , Medium::MsgSet const & currentReception ) ;
	void	update_waitConfirmACK	( UInteger currentTime , Medium::MsgSet const & currentReception ) ;
	void	update_waitCollision	( UInteger currentTime , Medium::MsgSet const & currentReception ) ;
} ;



SimNamespaceEnd
#endif
